package com.cec.mapper.admin;

import com.cec.dto.CategoryDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;


public interface CategoryMapper  {
    /**
     * 添加活动类别
     * @param categoryDTO
     * @return
     */
    @Insert("insert into activity_type (type_name) values (#{name});")
    int saveActivityCategory(CategoryDTO categoryDTO);

    /**
     * 添加资讯类别
     * @param categoryDTO
     * @return
     */
    @Insert("insert into info_type (type_name) values (#{name});")
    int saveInfoCategory(CategoryDTO categoryDTO);

    /**
     * 修改活动类别
     * @param categoryDTO
     * @return
     */
    @Update("update activity_type set type_name = #{name}  where id = #{id} ;")
    int updateActivityCategory(CategoryDTO categoryDTO);

    /**
     * 修改资讯类别
     * @param categoryDTO
     * @return
     */
    @Update("update info_type set type_name = #{name} where  id = #{id} ;")
    int updateInfoCategory(CategoryDTO categoryDTO);

    /**
     * 删除活动类别
     * @param id
     * @return
     */
    @Delete("delete from activity_type where id = #{id};")
    int deleteActivityCategory(Integer id);

    /**
     * 删除资讯类别
     * @param id
     * @return
     */
    @Delete("delete from info_type where id = #{id} ;")
    int deleteInfoCategory(Integer id);
}
